package com.gh.pattern.decorator.upgrade;


import com.gh.pattern.decorator.old.ISignService;
import com.gh.pattern.decorator.old.ResultMsg;
import com.gh.pattern.decorator.old.SignService;

public class SignForThirdService implements ISignForThirdService {

    private ISignService iSignService;

    public SignForThirdService (ISignService iSignService)  {
        this.iSignService = iSignService;
    }

    public ResultMsg loginForWeixin(String openId) {

        return null;
    }

    public ResultMsg loginForTel(String phonenum,String code) {
        return null;
    }
    public ResultMsg loginForAli(String token) {
        loginForRegist(token,null);
        return null;
    }
    public ResultMsg loginForRegist(String username,String password) {
        this.regist(username,null);
        return this.login(username,null);
    }

    @Override
    public ResultMsg regist(String username, String password) {
        return iSignService.regist(username,password);
    }

    @Override
    public ResultMsg login(String username, String password) {
        return iSignService.login(username,password);
    }
}
